package com.naiterui.ehp.bs.cms.modules.wms.feign;

import com.naiterui.ehp.bp.bo.b2c.cms.CmsSkuBO;
import com.naiterui.ehp.bp.bo.b2c.cms.ProductBO;
import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bp.support.exception.ResponseVO;
import javax.validation.constraints.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

@RequestMapping("/inner/cms/sku")
@FeignClient(name = "sku", url = "${ehp.domain.b2c}", configuration = FeignConfiguration.class)
public interface ISkuFeignClient {

    @PostMapping
    void saveOrUpdate(@RequestBody CmsSkuBO skuVO) throws BusinessException;

    @PutMapping("/defautl/{productId}/{skuId}")
    void updateDefatule(@PathVariable("productId") @NotNull(message = "productId不能为null") Long productId,
        @PathVariable("skuId") @NotNull(message = "skuId不能为null") Long skuId) throws BusinessException;

    @PostMapping("/saveOrUpdate")
    public ResponseVO<Void> saveOrUpdate(@RequestBody ProductBO product) throws BusinessException;
}
